from pydantic import BaseModel
from typing import Optional, List

from services.new_services.new_server_integration.schemas.subblock import BlockWord
from services.new_services.new_server_integration.schemas.common_configuration import BlockType
from services.new_services.new_server_integration.schemas.channels_configuration import ConnectionType


class SmsObject(BaseModel):
    state: str = BlockWord.NOERRORS
    value: Optional[int] = 900
    editable: bool = False


class SmsResponse(BaseModel):
    statuses_list: List[Optional[SmsObject]] = [SmsObject()]


class RmsResponse(BaseModel):
    statuses_list: List[Optional[BlockWord]] = [BlockWord.BLOCKED, BlockWord.BLOCKED]


class OpticsResponse(BaseModel):
    statuses_list: List[Optional[BlockWord]] = [BlockWord.BLOCKED, BlockWord.BLOCKED]


class ShortBlockInfoResponse(BaseModel):
    city: Optional[str] = 'Ижевск'
    block_type: Optional[str] = BlockType.FSC
    block_name: Optional[str] = 'KONOHA'
    block_number: Optional[str] = '666'
    block_cviya: Optional[str] = 'ЦВИЯ.Сервисная'
    sim_ip: Optional[str] = '0.0.0.0'
    server_ip: Optional[str] = '0.0.0.0'
    block_ip: Optional[str] = '0.0.0.0'
    mac: Optional[str] = 'NO_MAC'
    sms: List[Optional[SmsObject]] = [SmsObject()]
    rm1: BlockWord = BlockWord.BLOCKED
    rm2: BlockWord = BlockWord.BLOCKED
    optic1: BlockWord = BlockWord.BLOCKED
    optic2: BlockWord = BlockWord.BLOCKED
    power: BlockWord = BlockWord.BLOCKED
    modem: BlockWord = BlockWord.BLOCKED
    dsp: BlockWord = BlockWord.BLOCKED
    gps: BlockWord = BlockWord.BLOCKED
    connection_type_link_1: ConnectionType = ConnectionType.EMPTY
    connection_type_link_2: ConnectionType = ConnectionType.EMPTY
    sms_indexes: List[int] = [0, 1, 2, 3]
